/*---------------------------------------------------------------------------*/
#ifndef MENUMAKER_H
#define MENUMAKER_H
/*---------------------------------------------------------------------------*/
#include <string>
#include <QWidget>
#include <QtGui>
#include <vector>
#include "FileNode.h"
#include "Utils.h"
#include "MenuAction.h"
/*---------------------------------------------------------------------------*/
using namespace std;
/*---------------------------------------------------------------------------*/
class BrowserBox;
/*---------------------------------------------------------------------------*/
class MenuMaker : public QObject
{
	Q_OBJECT
	
	public:
	
						MenuMaker( vector<FileNode*> *vfn, BrowserBox *_flw );		
						MenuMaker();				
						~MenuMaker();
	
	void				show();
	void				runAction(int i=0);
	
	void				setDropMenu(vector<FileNode*> *vfn, BrowserBox *flw);
		
	private:
	
	QMenu				*menu;
	vector<MenuAction*> v_actions;
	vector<FileNode*> 	v_files;
	
	BrowserBox		*flw;
	
	vector<MenuAction*> getActionsFromConfig( FileNode *fn );
	vector<MenuAction*> poolActions( vector<MenuAction*> first, vector<MenuAction*> second );
	
	void				addFolderAction(vector<MenuAction*> *v);
	
	void				connectActions();
	

	
	private slots:
	
	void				actionClicked( QAction *action );
	
};
/*---------------------------------------------------------------------------*/
#endif
